<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"/>"></script>
<link id="theme" rel="stylesheet" type="text/css"  href="<c:url value="js/jquery-easyui-1.5.4.2/themes/ui-cupertino/easyui.css"/>"/>
<link  rel="stylesheet" type="text/css" href="<c:url value="js/jquery-easyui-1.5.4.2/themes/icon.css"/>"/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>员工录用</title>
</head>
<body>
<script type="text/javascript">
	$(function(){
		$(".staffployed_insert").linkbutton({
			onClick:function(){
				/* $(".emp_staffe").panel({
					href:"to_staffemployedinsert"
					
				}) */
				var table =  $("#hire-table").datagrid("getSelections");
				if(table.length==0){
					$.messager.alert('错误', '对不起，操作失败，没有选中的行');
				}else{
					for(var i = 0 ;i < table.length;i++){
						$.getJSON("to_staffemployedinsert",{id:table[i].JSR_ID,id2:table[i].POSITION_ID,name:table[i].JSR_NAME},function(v){
							if(v){
								$("#hire-table").datagrid("reload");
								
							}
						})
					}
					
				}
			}
		})
		
		
		
		
		
		//创建选项卡
		var openTab = function(title, href) {
			//添加新的选项卡
			var openTab = function(title, href){
			//先判断是否已经打开
			if($("#tt").tabs("exists", title)){
			//已打开，则激活
			$("#tt").tabs("select", title);
			}else{
			//未打开，则打开
			$("#tt").tabs("add",{
			title: title,
			href: href,
			closable:true
			});
			}
			}
			openTab(title,href);
			
			var tabcount = $('#tt').tabs("tabs").length;
			var msg = '您当前打开了太多的页面，如果继续打开，会造成程序运行缓慢，无法流畅操作！您确定还要继续打开吗？';
			if(tabcount>5){
				$.messager.confirm('确认',msg,function(r){    
				    if (r){    
				    	
				    }else{	
				    	var tab = $("#tt").tabs("getSelected");
						var index = $("#tt").tabs("getTabIndex",tab);
						$("#tt").tabs("close",index);
						
				    } 
				}); 	
			}
			
		};
		
		$(".staffployed_update").linkbutton({
			onClick:function(){
				var editselete= $("#hire-table").datagrid("getSelected");
				openTab("求职人员登记","hr_jsr");
				
			}
		});
		
		
		
		
	});
</script>
<div class="easyui-panel emp_staffe"  data-options="fit:true,border:false">
	<table class="easyui-datagrid" id="hire-table" data-options="
				fitColumns:true,
				fit:true,
				newrap:true,
				rownumbers:true,
				pagination:true,
				pageList:[5,10,15,20],
				pageSize:5,
				toolbar:'#toolbar6',
				border:false,
				url:'to-findall-hirestaff'
				">
			<thead>
				<tr>
					<th data-options="field:'JSR_ID',checkbox:true,width:30,align:'center'"></th> 
					<th data-options="field:'JSR_NAME',width:50,align:'center'">员工名称</th>
					<th data-options="field:'POSITION_ID',width:50,align:'center'">录用职位ID</th>
					<th data-options="field:'POSITION_NAME',width:50,align:'center'">录用职位</th>
					<th data-options="field:'JSR_PLANTIME',width:50,align:'center',
							formatter:function(value,row,index){
							var date = new Date(value);
							return date.toLocaleString();
					}">录用时间</th>
					
				</tr> 
			</thead>
			<tbody>
			</tbody>
		</table>
		<div  id="toolbar6"  >
			<a href="#" class="easyui-linkbutton staffployed_insert" data-options="iconCls:'icon-add',plain:true,text:'新增',iconAlign:'left'"></a>
                <a href="#" class="easyui-linkbutton staffployed_update" data-options="iconCls:'icon-edit',plain:true,text:'编辑',iconAlign:'left'"></a>
				
		</div>
</div>		
					
</body>
</html>